namespace Vin.Extension.RocketMQ.Attributes;

public class ProducerAttribute : Attribute
{
    /// <summary>
    /// 主题
    /// </summary>
    public string[] Topics { get; set; }

    /// <summary>
    /// 最大重试次数
    /// </summary>
    public int MaxAttempts { get; set; }

    public ProducerAttribute(string topics)
    {
        Topics = new[] { topics };
    }
    
    public ProducerAttribute(params string[] topics)
    {
        Topics = topics;
    }
    
    public ProducerAttribute(string topics, int maxAttempts)
    {
        Topics = new[] { topics };
        MaxAttempts = maxAttempts;
    }
}